<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	// class Box{
	// 	age = 12;
	// 	fn(){
	// 		console.log("fn")
	// 	}
	// }
	// class Desk extends Box{
	// 	userName = "wangwu";
	// }
	// const obj = new Desk();
	// // console.log(obj.userName,obj.age);
	// // obj.fn();
	// console.log(obj.__proto__ === Desk.prototype);// true
	// console.log(Desk.prototype.__proto__ === Box.prototype);// true
	// console.log(Box.prototype.__proto__ === Object.prototype);// true
	// console.log(Object.prototype.__proto__);// null
	
	
	{
		class Box{
			constructor(a,b) {
				console.log(a,b)
			}
			fn(){
				console.log("Box->fn")
			}
		}
		class Desk extends Box{
			constructor(a,b) {
				super(a,b);
			}
			fn(){
				console.log("desk->fn")
				super.fn();// 调用父级
			}
		}
		const obj = new Desk(1,2);
		// console.log(obj);
		obj.fn();
	}
</script>
</html>